-----------------------------------
-- Area: Lower Jeuno
-- NPC:  Streetlamp
-- Quests: Community Service
-- @zone 245
-- @pos -52.752, 0, -60.492
-----------------------------------
package.loaded["scripts/zones/Lower_Jeuno/TextIDs"] = nil;
-----------------------------------

require("scripts/globals/settings");
require("scripts/globals/quests");
require("scripts/zones/Lower_Jeuno/TextIDs");

-----------------------------------
-- onTrade Action
-----------------------------------

function onTrade(player,npc,trade)
end; 

-----------------------------------
-- onTrigger Action
-----------------------------------

function onTrigger(player,npc)
	local hour = VanadielHour();

	if (hour >= 18 and hour < 21) then
		if (player:getQuestStatus(JEUNO,COMMUNITY_SERVICE) == QUEST_ACCEPTED) then
			if (player:getVar("cService") == 5) then
				player:setVar("cService",6);
			end
		
		elseif (player:getQuestStatus(JEUNO,COMMUNITY_SERVICE) == QUEST_COMPLETED) then
			if (player:getVar("cService") == 18) then
				player:setVar("cService",19);
			end
		else
			player:showText(player,STREETLAMP_EXAMINE);
		end
	else
		player:showText(player,STREETLAMP_EXAMINE);
	end
end;

-----------------------------------
-- onEventUpdate
-----------------------------------

function onEventUpdate(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);
end;

-----------------------------------
-- onEventFinish
-----------------------------------

function onEventFinish(player,csid,option)
--printf("CSID: %u",csid);
--printf("RESULT: %u",option);	
end;